package www.dashu.com.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.Formula;
import www.dashu.com.domain.base.BaseVo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name="oms_order_return_apply")
public class OmsOrderReturnApply extends BaseVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("")
    @Id
    private Long id;

    @ApiModelProperty("订单id")
    @Column(name = "order_id")
    private Long orderId;

    @ApiModelProperty("收货地址表id")
    @Column(name = "company_address_id")
    private Long companyAddressId;

    @ApiModelProperty("会员用户名")
    @Column(name = "u_id")
    private Long uId;

    @ApiModelProperty("退款金额")
    @Column(name = "return_amount")
    private Double returnAmount;

    @ApiModelProperty("退货人姓名")
    @Column(name = "return_name")
    private String returnName;

    @ApiModelProperty("退货人电话")
    @Column(name = "return_phone")
    private String returnPhone;

    @ApiModelProperty("申请状态：0->待处理；1->退货中；2->已完成；3->已拒绝")
    @Column(name = "status")
    private Integer status;

    @ApiModelProperty("处理时间")
    @Column(name = "handle_time")
    private Date handleTime;

    @ApiModelProperty("商品图片")
    @Column(name = "product_pic")
    private String productPic;

    @ApiModelProperty("商品名称")
    @Column(name = "product_name")
    private String productName;

    @ApiModelProperty("商品品牌")
    @Column(name = "product_brand")
    private String productBrand;

    @ApiModelProperty("商品销售属性：颜色：红色；尺码：xl;")
    @Column(name = "product_attr")
    private String productAttr;

    @ApiModelProperty("退货数量")
    @Column(name = "product_count")
    private Integer productCount;

    @ApiModelProperty("商品单价")
    @Column(name = "product_price")
    private Double productPrice;

    @ApiModelProperty("商品实际支付单价")
    @Column(name = "product_real_price")
    private Double productRealPrice;

    @ApiModelProperty("原因")
    @Column(name = "reason")
    private String reason;

    @ApiModelProperty("描述")
    @Column(name = "description")
    private String description;

    @ApiModelProperty("凭证图片，以逗号隔开")
    @Column(name = "proof_pics")
    private String proofPics;

    @ApiModelProperty("处理备注")
    @Column(name = "handle_note")
    private String handleNote;

    @ApiModelProperty("处理人员")
    @Column(name = "handle_man")
    private String handleMan;

    @ApiModelProperty("收货人")
    @Column(name = "receive_man")
    private String receiveMan;

    @ApiModelProperty("收货时间")
    @Column(name = "receive_time")
    private Date receiveTime;

    @ApiModelProperty("收货备注")
    @Column(name = "receive_note")
    private String receiveNote;

    @ApiModelProperty("所属商户")
    @Formula("(select s.name from sys_company s where s.id = company )")
    private String companyName;

    @Column(name = "company")
    private Long company;

    @ApiModelProperty("所属应用")
    @Formula("(select s.name from sys_app s where s.id = app_id )")
    private String appName;

    @Column(name = "app_id")
    private Long appId;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time")
    private Date updateTime;


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderId=").append(orderId);
        sb.append(", companyAddressId=").append(companyAddressId);
        sb.append(", uId=").append(uId);
        sb.append(", returnAmount=").append(returnAmount);
        sb.append(", returnName=").append(returnName);
        sb.append(", returnPhone=").append(returnPhone);
        sb.append(", status=").append(status);
        sb.append(", handleTime=").append(handleTime);
        sb.append(", productPic=").append(productPic);
        sb.append(", productName=").append(productName);
        sb.append(", productBrand=").append(productBrand);
        sb.append(", productAttr=").append(productAttr);
        sb.append(", productCount=").append(productCount);
        sb.append(", productPrice=").append(productPrice);
        sb.append(", productRealPrice=").append(productRealPrice);
        sb.append(", reason=").append(reason);
        sb.append(", description=").append(description);
        sb.append(", proofPics=").append(proofPics);
        sb.append(", handleNote=").append(handleNote);
        sb.append(", handleMan=").append(handleMan);
        sb.append(", receiveMan=").append(receiveMan);
        sb.append(", receiveTime=").append(receiveTime);
        sb.append(", receiveNote=").append(receiveNote);
        sb.append(", company=").append(company);
        sb.append(", appId=").append(appId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

}